﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class LinePath : MonoBehaviour
{
    public static LinePath Instance;
    private void Awake()
    {
        Instance = this;
    }
    // Start is called before the first frame update
    void Start()
    {

    }

    // Update is called once per frame
    void Update()
    {
        
    }
    public LineRenderer lineRedner;

    public void ShowPath(List<MapItem> mapItemList)
    {
        lineRedner.positionCount = mapItemList.Count;
        for (int i = 0; i < mapItemList.Count; i++)
        {
            var vec = HexMetrics.GetPosFromHexGrid(mapItemList[i].x, mapItemList[i].y);
            UtilGeometry.SetHigh(ref vec, HexMetrics.DefaultHigh + 0.1f);
            lineRedner.SetPosition(i, vec);
        }
    }
}
